-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not supported property values #763
Not supported property values #763
Conversation
Again, I won't review the code here but the idea is pretty great. The question really is whether we want to try to distinguish between:
There's a bunch of discussion in mdn/interactive-examples#441 about this. The yellow cross mark is really intended for when people try typing a value and make a mistake, so they can see they made a mistake. Using the same mark for "not supported" might confuse that a little. However:
So I think this is definitely better than what we have now! |
I wonder if it would be better to show the "x" as well as the border all the time, and not only when an item is selected. I think if you opened https://developer.mozilla.org/en-US/docs/Web/CSS/text-transform in Chrome and saw only that the last two had the border, as opposed to the border and the "x", then it might not be very obvious what that means. |
Thank you so much for your contribution @NiedziolkaMichal. @mdn/core-dev when you have a moment, a review of the code here would be great. Thank you. |
@NiedziolkaMichal , sorry if this is an obvious question, but what will happen if the property as a whole isn't supported, rather than some particular values? Will it be the same as it is now, or will all the options get the cross? And what would we like to happen here? I'm asking because of mdn/content#15824 - I really don't like the current behavior, but not sure I like the "all options get the cross" option much better... |
In case one of used properties is not supported, example would have an orange outline and "X" on the right. However if base property is not supported, examples wouldn't be shown at all and warning introduced in PR #759 would be presented instead. |
This pull request has merge conflicts that must be resolved before it can be merged. |
eab958b
to
5a4372d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is LGTM, thank you!
Thanks a lot |
This is fix for issues #441, #455 and #354.
Currently when property name or its value is not supported, they are simply not being applied without any warning. Only when user changes code content, warning might be shown, but this also doesn't work when just part of declaration block is not supported.
This is quite significant, because plenty of CSS property values are currently used in interactive examples, even though they are not supported at all. This is list of values not supported by Chrome, but still displayed to those users:
I have made not supported values, but immediately shown to the users like this:
When interactive example is loaded, when reset button is used or when user types in something, it is checked whether whole declaration is property supported by the browser. This warning doesn't shown up, if unsupported property has vendor prefix or if ordinary property is not supported but its vendor prefix equivalent is supported correctly.
I have checked how my code works with every single declaration, currently being used in interactive-examples repository. You can check it by yourself by running this page: https://pastebin.com/73zGPWGG
There are 3 issues which require changing something in interactive-examples:
Except for that, everything seems to be ok.
@wbamberg @schalkneethling